﻿
CREATE PROCEDURE [dbo].[proc_ProjectInterfaceSet_GetItem]
	(
		@ProductId int
	)
AS
	Select 
		Id,
		CId,
		(select pc.title from Product_Category pc where pc.id=ProjectInterfaceSet.cid) as CategoryName,
		Title,
		CostPrice,
		SalePrice,
		Description,
		Sort,
		isnull(CompanyId,0) as CompanyId,
		isnull(DepartmentId,0) as DepartmentId,
		(select d.dname from department d where d.id = ProjectInterfaceSet.departmentid) as DepartmentName,
		UserName,
IsNull(ExCompanyId,CompanyId) As ExCompanyId
		--(select e.ename from employee e where e.username=ProjectInterfaceSet.username) as UserName
	From
		ProjectInterfaceSet 
	Where 
		Id = @ProductId
	
	RETURN
